package com.web44.springboot.servlet;

import com.web44.springboot.utils.ResponseVo;
import com.web44.springboot.utils.ServletUtils;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

/**
 * @Title: HelloServlet
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/2/29 15:14
 */
public class HelloServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ServletUtils.renderString(resp, ResponseVo.ok("hello servlet"));
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req,resp);
    }
}
